import "normalize.css"; // normalize.css 比较温和的初始化 css 文件
import "@/assets/styles/base.css";
import "@/assets/styles/theme.scss";
import { createApp } from "vue";
import { createPinia } from "pinia";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import App from "./App.vue";
import "element-plus/theme-chalk/dark/css-vars.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import tool from "@/utils/common/index";
import router from "@/router/index";
import i18n from "./locales/i18n";
import "@/assets/font/font_4653548_m6l0omepsy/iconfont.css";
import "@/router/permission";
import "@fortawesome/fontawesome-free/css/all.min.css";

zhCn.el.pagination.total = "共 {total} 条";
zhCn.el.pagination.goto = "跳至";
zhCn.el.pagination.pagesize = "条/页";
zhCn.el.pagination.pageClassifier = "页";

/**
 * 别忘记注释掉下方的 mocks 拦截
 */
// if (import.meta.env.DEV) {
//   const { worker } = await import("@/mocks/browser");
//   await worker.start({ onUnhandledRequest: "bypass" });
// }
// ============== 上方是 mocks 拦截  ==============
const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.config.globalProperties.$tool = tool;
const pinia = createPinia();
app.use(ElementPlus, { locale: zhCn });
app.use(pinia);
app.use(router);
app.use(i18n);

app.mount("#app");
